home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / dialupip / dialupip2.0 / doc / implement.ms < prev    next >
Encoding:
Text File  |  1991-01-14  |  8.7 KB  |  220 lines

  1. .\" $Header: implement.ms,v 2.0 91/01/11 17:12:01 rsalz Exp $
  2. .\"  Copyright (c) 1991 Bolt Beranek and Newman, Inc.
  3. .\"  All rights reserved.
  4. .\"
  5. .\"  Redistribution and use in source and binary forms are permitted
  6. .\"  provided that: (1) source distributions retain this entire copyright
  7. .\"  notice and comment, and (2) distributions including binaries display
  8. .\"  the following acknowledgement:  ``This product includes software
  9. .\"  developed by Bolt Beranek and Newman, Inc. and CREN/CSNET'' in the
  10. .\"  documentation or other materials provided with the distribution and in
  11. .\"  all advertising materials mentioning features or use of this software.
  12. .\"  Neither the name of Bolt Beranek and Newman nor CREN/CSNET may be used
  13. .\"  to endorse or promote products derived from this software without
  14. .\"  specific prior written permission.
  15. .\"
  16. .\"  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  17. .\"  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  18. .\"  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  19. .TL
  20. Implementation of Dialup IP 2.0
  21. .AU
  22. Rich Salz
  23. .AI
  24. BBN Systems and Technologies
  25. Cambridge, MA  02139
  26. <rsalz@bbn.com>
  27. .AU
  28. Leo Lanzillo
  29. .AI
  30. CSNET Coordination and Information Center
  31. BBN Systems and Technologies
  32. Cambridge, MA  02139
  33. .NH 1
  34. Introduction
  35. .LP
  36. The Dialup IP software package provides full IP support over dialup
  37. phone lines.
  38. It runs on systems based on the 4.3BSD kernel, and requires a modem
  39. connected to a serial port on the machine.
  40. .LP
  41. The Dialup IP device driver is based on a modified SLIP driver originally
  42. written by Rick Adams and distributed with 4.3BSD.
  43. The major difference between SLIP and Dialup IP is that the Dialup IP
  44. disconnects the phone when not in use.
  45. This helps to keep costs down at the price of making the package more
  46. complicated.
  47. Before sending any data, the driver must verify that the line is up
  48. to the remote site, or make a connection if none currently exists.
  49. Similarly, the driver must notice when there is no data to be sent,
  50. and initiate the break-down of the call.
  51. .NH 1
  52. Software Components
  53. .LP
  54. There are kernel and user components to the software package.
  55. The kernel code includes the Dialup IP code and a request device
  56. used to determine when a connection should be initiated.
  57. The user-level components include programs to set up network interfaces
  58. and make the necessary calls.
  59. The dialing program reads configuration files specifying network
  60. devices and calling information and restrictions.
  61. .NH 1
  62. Routing
  63. .LP
  64. The Dialup IP software does not use any special routing to communicate with
  65. remote hosts.
  66. A ``du'' software device allocated for each remote destination, and the
  67. existing IP layer takes care of routing packets to the correct device.
  68. .LP
  69. When the device driver receives a packet for transmission, it faces two
  70. conditions:  either the link is up and the packet can be sent, or
  71. the link is down and the packet must be queued until the link comes up.
  72. Either host on the point-to-point link can bring the link up.
  73. .NH 1
  74. Flow of Control
  75. .LP
  76. The various software components and their interaction are discussed below.
  77. .NH 2
  78. Kernel Code
  79. .LP
  80. If the link is not up, the Dialup IP driver signals a user program which
  81. attempts to bring the line up.
  82. It will then notify the Dialup IP driver that the link is up and ready for
  83. use.
  84. The Dialup IP driver notifies the daemon by writing data to the input
  85. buffer of the \fI/dev/dialup0\fP device and waking up any process waiting
  86. on that buffer.
  87. The data sent contains the interface name, a ``sockaddr' with the address
  88. of the remote host, and the IP header of the first packet destined for
  89. that host.
  90. .NH 2
  91. User Code
  92. .LP
  93. There are two halves to the user code.
  94. One half is used on the initiating, or dialout, end, and the other half
  95. is used on the receiving, or dialin, end.
  96. .LP
  97. On the dialout host the program \fIdiald\fP continually reads from
  98. \fI/dev/dialup0\fP waiting for requests to initiate calls.
  99. When request data comes in, it spawns a child to make the call.
  100. The child reads the config and dialing script files and tries to negotiate
  101. a login to the remote host.
  102. .LP
  103. On the dialin host there is a special login shell which is used to bring
  104. up the Dialup IP line discipline on the incoming line.
  105. .NH 3
  106. Access Control
  107. .LP
  108. Before waiting for requests, \fIdiald\fP reads a configuration file that
  109. lists the each ``du'' interface and the names the the tty ports to use,
  110. and script to execute.
  111. An access file can also be named, limiting the circumstances under which a
  112. call will be initiated.
  113. Calls can be limited based on any combination of the following factors:
  114. .DS
  115. Source host or network
  116. Destination host or network
  117. Time of day
  118. Protocol
  119. .DE
  120. .NH 2
  121. Call Setup
  122. .LP
  123. After reading the packet, \fIdiald\fP finds the entry for the given interface.
  124. It then performs security checks on the protocol, source and destination,
  125. and time of day.
  126. If the request is legitamite, it forks and the child runs the script to
  127. dial the phone number, and go through the login sequence.
  128. .LP
  129. At the remote (dialin) end, a special shell is invoked (normally called
  130. \fIdudisc\fP, although other packages are available), and there can be
  131. further handshaking between the dialing process and the shell.
  132. Once the sequence is complete the both the child and the remote
  133. special shell do \fIioctl\fP's to bring their end of the interface up,
  134. and to change the line discipline on the tty.
  135. Both processes then sleep until the line is dropped, at which time they
  136. clean up and exit.
  137. .LP
  138. Because the dialing process and the special shell sleep instead of dying,
  139. UNIX believes the tty port is still in use.
  140. This prevents other \fIgetty\fP's from running on the passive end and
  141. prevents the line discipline from being reset on both ends.
  142. .NH 2
  143. Data Transmission
  144. .LP
  145. Once the dialing process and remote shell have completed their \fIioctl\fP
  146. calls, the line is ready for data transmission.
  147. .NH 3
  148. Output
  149. .LP
  150. Dialup IP is implemented as an interface to the IP layer; the IP layer
  151. determines on which interface a particular destination can be reached
  152. and transmits the packet out that interface via the \fIifnet\->if_output\fP
  153. routine.
  154. Similarly, Dialup IP \fIioctl\fP's and initialization routines are reached
  155. via the \fIifnet\fP structure.
  156. The Dialup driver's output routine simply verifies that the line is up
  157. and then transmits the packet.
  158. The output routine sends frame characters to delineate the packet.
  159. .LP
  160. The framed packet is transmitted by placing each character into the clist
  161. associated with the tty device.
  162. The hardware device driver asynchronously processes the characters from the
  163. clist.
  164. .NH 3
  165. Input
  166. .LP
  167. On input, data is received by the hardware device.
  168. Since the data is coming in over a tty line, there is a tty structure
  169. for each connection.
  170. This structure contains a pointer to the line discipline which should be used
  171. to process the incoming characters.
  172. When the connection was established, the line discipline on the port was
  173. set up to refer to the Dialup IP driver.
  174. Instead of doing character processing, it collects characters into packets,
  175. does simple header checking and enqueues the packets in the IP input queue.
  176. .NH 2
  177. Call Tear-Down
  178. .LP
  179. In order to close down phone calls when there is no data to send, there are
  180. activity timers on the interface which time out inactive lines and
  181. failed connections.
  182. These are two separate types of failures.
  183. .NH 3
  184. Failed Calls
  185. .LP
  186. The dialing programs recognize a number of reasons why a call can fail,
  187. including but not limited to:
  188. .DS
  189. Configuration file problems such as a bad port or device
  190. Authorization failure
  191. Problems placing a phone call such as line busy
  192. Failure to run the script correctly
  193. .DE
  194. .LP
  195. If such a failure occurs, a log message is reported and the process exits;
  196. the \fIioctl\fP's to change the line discipline and to mark the interface
  197. up are never executed.
  198. As a result, outbound packets collect in the queue and eventually the
  199. Dialup IP driver will time out waiting for the interface to come up.
  200. .NH 3
  201. Timeouts
  202. .LP
  203. The Dialup IP code can recognize timeouts both on connection attempts and
  204. on line activity.
  205. Once it has notified \fIdiald\fP that it has data to send out, the Dialup
  206. driver waits for the interface to come up.
  207. If the interface isn't marked as up within a specified time, the driver
  208. will clear the interface's output queues and reset the state of the interface.
  209. .LP
  210. A similar sequence occurs if the Dialup IP code detects that there has not
  211. been traffic on the interface for some length of time.
  212. When such a timeout occurs, a SIGHUP is sent to the processes associated
  213. with that tty.
  214. This gives both ends the ability to timeout the line.
  215. (Depending on whether the dialout end or the remote end timed out, either
  216. the dialing process or the special shell will receive this signal.)
  217. .LP
  218. The \fIduioctl\fP program can be used to dynamically modify the timeout
  219. parameters.
  220.